package com.hxut.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;

/**
 * description: IndexRestController
 * date: 2022/5/28 12:51
 * author: MR.孙
 */
@RestController
public class IndexRestController {
    @GetMapping
    public Map<String,Object> index(HttpServletRequest request, HttpServletResponse response){
        Map<String, Object> map = new HashMap<>();

        HttpSession session = request.getSession();

        String id = session.getId();
        map.put("sessionId",id);
        return map;
    }
}
